home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / xshogi11.lha / xshogi-1.1 / xshogi.h < prev    next >
C/C++ Source or Header  |  1993-04-27  |  6KB  |  156 lines

  1. /*
  2.  * XShogi
  3.  * based on XBoard -- an Xt/Athena user interface for GNU Chess
  4.  *
  5.  * Original authors of XBoard:  Dan Sears and Chris Sears
  6.  * Enhancements for XBoard (Version 2.0):  Tim Mann
  7.  * Modifications to XShogi (Version 1.0): Matthias Mutz 
  8.  * Enhancements to XShogi (Version 1.1): Matthias Mutz 
  9.  *
  10.  * XShogi borrows its piece bitmaps from CRANES Shogi.  
  11.  *
  12.  * Copyright 1991 (XBoard) by Digital Equipment Corporation, Massachusetts.
  13.  * Enhancements for XBoard Copyright 1992 Free Software Foundation, Inc.
  14.  * Enhancements for XShogi Copyright 1993 Matthias Mutz
  15.  *
  16.  * The following terms apply to Digital Equipment Corporation's copyright
  17.  * interest in XBoard:
  18.  * ------------------------------------------------------------------------
  19.  * All Rights Reserved
  20.  *
  21.  * Permission to use, copy, modify, and distribute this software and its
  22.  * documentation for any purpose and without fee is hereby granted,
  23.  * provided that the above copyright notice appear in all copies and that
  24.  * both that copyright notice and this permission notice appear in
  25.  * supporting documentation, and that the name of Digital not be
  26.  * used in advertising or publicity pertaining to distribution of the
  27.  * software without specific, written prior permission.
  28.  *
  29.  * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  30.  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  31.  * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  32.  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  33.  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  34.  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  35.  * SOFTWARE.
  36.  * ------------------------------------------------------------------------
  37.  *
  38.  * The following terms apply to the enhanced version of Xshogi distributed
  39.  * by the Free Software Foundation:
  40.  * ------------------------------------------------------------------------
  41.  * This file is part of XSHOGI.
  42.  *
  43.  * XSHOGI is distributed in the hope that it will be useful, but WITHOUT ANY
  44.  * WARRANTY.  No author or distributor accepts responsibility to anyone for
  45.  * the consequences of using it or for whether it serves any particular
  46.  * purpose or works at all, unless he says so in writing.  Refer to the XSHOGI
  47.  * General Public License for full details.
  48.  *
  49.  * Everyone is granted permission to copy, modify and redistribute XSHOGI, but
  50.  * only under the conditions described in the XSHOGI General Public License. A
  51.  * copy of this license is supposed to have been given to you along with
  52.  * XSHOGI so you can know your rights and responsibilities.  It should be in a
  53.  * file named COPYING.  Among other things, the copyright notice and this
  54.  * notice must be preserved on all copies.
  55.  * ------------------------------------------------------------------------
  56.  */
  57.  
  58. #define BOARD_SIZE        9
  59. #define DROP_LINES        3
  60. #define DROP_COLS        3
  61. #ifdef WESTERN_BITMAPS
  62. #define LARGE_SQUARE_SIZE    32
  63. #define MEDIUM_SQUARE_SIZE    32
  64. #else
  65. #define LARGE_SQUARE_SIZE    64
  66. #define MEDIUM_SQUARE_SIZE    49
  67. #endif
  68. #define SMALL_SQUARE_SIZE       32
  69. #define LINE_GAP        2
  70. #define MAX_MOVES        512
  71. #define MSG_SIZ            256
  72. #define DIALOG_SIZE        256
  73. #define MOVE_
  74. #define MOVE_LEN        16      /* enough for "Black resigns\000"*/
  75. #define TIME_CONTROL        "5"    /* in minutes */
  76. #define TIME_DELAY        "1.0"    /* seconds between moves */
  77. #define MOVES_PER_SESSION    40    /* moves per TIME_CONTROL */
  78. #define BLACK_ON_MOVE        ((int) ((currentMove % 2) == 0))
  79. #define ATTENTION
  80. #ifndef FIRST_CHESS_PROGRAM
  81. #define FIRST_CHESS_PROGRAM    "gnushogix1"
  82. #endif
  83. #ifndef SECOND_CHESS_PROGRAM
  84. #define SECOND_CHESS_PROGRAM    "gnushogix2"
  85. #endif
  86. #ifndef FIRST_HOST
  87. #define FIRST_HOST        "localhost"
  88. #endif
  89. #ifndef SECOND_HOST
  90. #define SECOND_HOST        "localhost"
  91. #endif
  92. #define MATCH_MODE        "False"
  93. #define INIT_STRING        "beep\neasy\nrandom\n"
  94. #define BLACK_STRING        "black\ngo\n"
  95. #define WHITE_STRING        "white\ngo\n"
  96. #define DEFAULT_SIZE            "Small"
  97. #define BLACK_PIECE_COLOR    "#FFFFD7"
  98. #define WHITE_PIECE_COLOR    "#FFFFD7"
  99. #define LIGHT_SQUARE_COLOR    "#EBDFB0"
  100. #define DARK_SQUARE_COLOR    "#EBDFB0"
  101. #define COORD_FONT "-*-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"
  102. #define BLINK_COUNT 3    /* number of machines to-square blinks */
  103.  
  104.  
  105.  
  106. typedef enum {
  107.     Large, Medium, Small
  108. } BoardSize;
  109.  
  110. typedef enum {
  111.     BeginningOfGame, MachinePlaysBlack, MachinePlaysWhite, TwoMachinesPlay,
  112.     ForceMoves, PlayFromGameFile, SetupPosition, PauseGame, EndOfGame,
  113.     EditPosition
  114. } GameMode;
  115.  
  116. typedef enum {
  117.     MatchFalse, MatchInit, MatchPosition, MatchOpening
  118. } MatchMode;
  119.           
  120.  
  121. typedef enum {
  122.     BlackPawn, BlackLance, BlackKnight, BlackSilver, BlackGold, BlackBishop, BlackRook, 
  123.         BlackPPawn, BlackPLance, BlackPKnight, BlackPSilver, BlackPBishop, BlackPRook, BlackKing,
  124.     WhitePawn, WhiteLance, WhiteKnight, WhiteSilver, WhiteGold, WhiteBishop, WhiteRook, 
  125.         WhitePPawn, WhitePLance, WhitePKnight, WhitePSilver, WhitePBishop, WhitePRook, WhiteKing,
  126.     EmptySquare,
  127.     ClearBoard, BlackPlay, WhitePlay /*for use on EditPosition menus*/
  128. } ChessSquare;
  129.  
  130. typedef ChessSquare Board[BOARD_SIZE][BOARD_SIZE];
  131.                    
  132. typedef int Catched[2][8];
  133.  
  134. typedef enum {
  135.     BlackPromotion = 1, WhitePromotion, BlackDrop, WhiteDrop,
  136.         NormalMove,
  137.     BlackWins, WhiteWins, GameIsDrawn, StartGame, BadMove, Comment,
  138.     AmbiguousMove
  139. } ChessMove;
  140.  
  141. typedef enum {
  142.     ResetTimers, DecrementTimers, SwitchTimers, 
  143.     ReDisplayTimers, StopTimers, StartTimers
  144. } ClockMode;
  145.  
  146. /*
  147.  * Various compatibility grunge
  148.  */
  149. #ifdef __STDC__
  150. #define    P(args)        args
  151. #define VOID_PROC    (void(*)(char*))
  152. #else
  153. #define P(args)        ()
  154. #define VOID_PROC
  155. #endif
  156.